package com.invest.amplegest.xml;

import java.io.File;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;

import com.invest.amplegest.debug.Debug;
import com.invest.amplegest.other.GlobalConstant;
import com.invest.amplegest.xml.bean.AldoField;
import com.invest.amplegest.xml.bean.AldoLine;

/**
 * Convertion Objet vers XML et inversement.
 * 
 * @author Jean-François Augé
 * 30 juil. 2014
 */
public class XMLUtil {

	/**
	 * Converti un Object Java en fichier XML.
	 * 
	 * @param obj, l'objet à convertir
	 * @param objClass, la classe de l'objet à convertir
	 * @param xmlPath,  le chemin du fichier XML.
	 */
	public static void jaxbObjectToXML(Object obj, Class<?> objClass, String xmlPath) {
		try {
			JAXBContext context = JAXBContext.newInstance(objClass);
			Marshaller m = context.createMarshaller();
			//for pretty-print XML in JAXB
			m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);

			// Write to System.out for debugging
			//m.marshal(obj, System.out);

			// Write to File
			m.marshal(obj, new File(xmlPath));

			if(Debug.CORE) Debug.display(XMLUtil.class, "Écriture du fichier XML terminée: "+xmlPath);
		} catch (JAXBException e) {
			e.printStackTrace();
		}
	}

	
	/**
	 * Lit la structure d'une ligne ALDO.
	 * 
	 * @return la structure de la ligne ALDO.
	 */
	public static AldoLine readAldoLineModel() {
		URL urlAldo = XMLUtil.class.getResource("/com/invest/amplegest/ressources/xml/aldo.xml");

		AldoLine aldoLine = null;
		try {
			JAXBContext jaxbContext = JAXBContext.newInstance(AldoLine.class);
			Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
			aldoLine = (AldoLine) jaxbUnmarshaller.unmarshal(urlAldo);
		} catch (JAXBException e) {
			e.printStackTrace();
		}

		if(Debug.CORE) Debug.display(XMLUtil.class, "Lecture du fichier XML terminée: "+urlAldo.getPath());

		return aldoLine;
	}

	/**
	 * Construit le modèle par défaut d'une ligne ALDO.
	 * 
	 * @return le modèle par défaut d'une ligne ALDO.
	 */
	public static AldoLine buildAldoLineModel() {
		List<AldoField> aldoFields = new ArrayList<>();

		//							num	name										techName			isMand	isNum	prec	coma	value
		aldoFields.add(new AldoField(1, "NUMERO ENREGISTREMENT / ALDO",				"FIL_NRECALDO",		true,	true, 6, 0,		""));
		aldoFields.add(new AldoField(2, "TYPE D'ENREGISTREMENT / ALDO",				"FIL_YRECALDO",		false,	false, 1, 0,	""));
		aldoFields.add(new AldoField(3, "DATE DU MESSAGE",							"FIL_DMSG",			true,	true, 8, 0,		""));
		aldoFields.add(new AldoField(4, "HEURE DU MESSAGE",							"FIL_HMSG",			true,	true, 6, 0,		""));
		aldoFields.add(new AldoField(5, "REFERENCE 2 DE L'OPERATION",				"FIL_CRF2OP",		true,	false, 16, 0,	""));
		aldoFields.add(new AldoField(6, "CODE ORIGINE REFERENCE 2 DE L'OPERATION",	"FIL_CORGRF2OP",	true,	false, 1, 0,		"G"));
		aldoFields.add(new AldoField(7, "CODE ORIGINE OPERATION CARNET",			"FIL_CORGOP",		true,	false, 1, 0,		"G"));
		aldoFields.add(new AldoField(8, "CODE UTILISATEUR CARNET",					"FIL_CUTLCRN",		false,	false, 6, 0,	""));
		aldoFields.add(new AldoField(9, "INDICATEUR DE ROUTAGE / REPONSE",			"FIL_IROREPO",		true,	false, 1, 0,		"N"));
		aldoFields.add(new AldoField(10, "LIBELLE DONNEUR D'ORDRES",				"FIL_LDDO",			false,	false, 20, 0,	""));
		aldoFields.add(new AldoField(11, "CODE GESTION",							"FIL_CGES",			false,	false, 5, 0,	""));
		aldoFields.add(new AldoField(12, "CODE ANALYTIQUE",							"FIL_CANA",			false, 	false, 3, 0,	""));
		aldoFields.add(new AldoField(13, "CODE ROUTAGE / EXECUTION",				"FIL_CROXTE",		false,	false, 1, 0,	""));
		aldoFields.add(new AldoField(14, "CODE SECTION / ETABLISSEMENT DE CREDIT",	"FIL_CSECETCR",		false,	false, 2, 0,	""));
		aldoFields.add(new AldoField(15, "CODE ENTITE DE NEGOCIATION",				"FIL_CEN",			true,	false, 10, 0,	""));
		aldoFields.add(new AldoField(16, "CODE FORCAGE DE L'ORDRE",					"FIL_CFCORD",		true,	false, 1, 0,		"N"));
		aldoFields.add(new AldoField(17, "CODE DOSSIER",							"FIL_CDOS",			true,	true, 11, 0,	"")); // false?
		aldoFields.add(new AldoField(18, "CODE REJET / CONTROLES DE RECEVABILITE",	"FIL_CRJCTLRCV",	true,	false, 3, 0,		"000"));
		aldoFields.add(new AldoField(19, "CODE SDB / DESTINATAIRE",					"FIL_CAGTDEST",		true,	false, 3, 0,		"000"));
		aldoFields.add(new AldoField(20, "TYPE DE MESSAGE",							"FIL_YMSGRO",		true,	false, 3, 0,		""));
		aldoFields.add(new AldoField(21, "CODE SITE EMETTEUR DU MESSAGE",			"FIL_CSITEMSG",		true,	false, 11, 0,	"00000000000"));
		aldoFields.add(new AldoField(22, "CODE LOGIQUE EMETTEUR_MESSAGE / RONA",	"FIL_CLOGEMSG",		true,	false, 11, 0,	"00000000000"));
		aldoFields.add(new AldoField(23, "DATE & HEURE DE RECEPTION DU MESSAGE",	"FIL_DHRCPCDR",		true,	true, 14, 0,	""));
		aldoFields.add(new AldoField(24, "REFERENCE OPERATION",						"FIL_CRFOP",		false,	false, 16, 0,	""));
		aldoFields.add(new AldoField(25, "CODE CLIENT ROUTAGE / RONA",				"FIL_CCLIRO",		false,	false, 11, 0,	""));
		aldoFields.add(new AldoField(26, "LIBELLE REDUIT CLIENT ROUTAGE",			"FIL_LRDCLIRO",		false,	false, 11, 0,	""));
		aldoFields.add(new AldoField(27, "CODE DESTINATAIRE DUPLICATA MESSAGE",		"FIL_CDESTDUPAMSG",	false,	false, 11, 0,	""));
		aldoFields.add(new AldoField(28, "INDICATEUR SENS OPERATION",				"FIL_ISENSOPCLIRO",	true,	false, 1, 0,		""));
		aldoFields.add(new AldoField(29, "CODE MARCHE NEGOCIATION / OPERATION",		"FIL_CMARNGOP",		false,	false, 3, 0,	""));
		aldoFields.add(new AldoField(30, "CODE VALEUR ISIN",						"FIL_CVALISIN",		true,	false, 12, 0,	""));
		aldoFields.add(new AldoField(31, "DATE RENVOI DE MESSAGE PAR LE ROUTAGE",	"FIL_DRVMSGRO",		true,	true, 8, 0,		""));
		aldoFields.add(new AldoField(32, "HEURE RENVOI MESSAGE PAR LE ROUTAGE",		"FIL_HRVMSGRO",		true,	true, 6, 0,		""));
		aldoFields.add(new AldoField(33, "LIBELLE INSTRUCTION COMPLEMENT MESSAGE",	"FIL_LINSTCPLMSG",	false,	false, 30, 0,	""));

		aldoFields.add(new AldoField(34, "CODE UNITE QUANTITE / QTE TITRES OPERATION",	"FIL_CUNIQ_QTITOP",	true,	false, 3, 0,		"QTE"));
		aldoFields.add(new AldoField(35, "QUANTITE DE TITRES DE L'ORDRE",			"FIL_QBTQ_QTITOP",	true,	true, 13, 2,	""));
		aldoFields.add(new AldoField(36, "DATE VALIDITE / OPERATION",				"FIL_DVALIOP",		true,	true, 8, 0,		""));
		aldoFields.add(new AldoField(37, "PRIX LIMITE 1 / 4 DEC",					"FIL_PLIM1_4DEC",	false,	true, 11, 4,	""));
		aldoFields.add(new AldoField(38, "DATE ECHEANCE / OPERATION",				"FIL_DECHOP",		false,	false, 8, 0,	""));
		aldoFields.add(new AldoField(39, "MONTANT COMMISSION BROKER",				"FIL_QCOMBRK",		false,	true, 14, 4,	""));
		aldoFields.add(new AldoField(40, "INDICATEUR OPERATION HORS COMPENSATION",	"FIL_IOPHCOMP",		false,	false, 1, 0,	"O"));
		aldoFields.add(new AldoField(41, "TYPE DE MODALITE D'EXECUTION",			"FIL_YMDTXTE",		false,	false, 4, 0,	""));
		aldoFields.add(new AldoField(42, "CODE UNITE / MODALITE EXECUTION",			"FIL_CUNIMDTXTE",	false,	false, 1, 0,	""));
		aldoFields.add(new AldoField(43, "NOMBRE LIMITE / MODALITE EXECUTION / 4 DEC",	"FIL_ZLIMMDTXTE_4DEC",	false,	true, 11, 4,	""));
		aldoFields.add(new AldoField(44, "CODE TRAITEMENT FICHE DE BOURSE",			"FIL_CTRTFBS",		true,	false, 1, 0,		"1"));
		aldoFields.add(new AldoField(45, "CODE DU LIEU DE ROUTAGE",					"FIL_CLIERO",		true,	false, 1, 0,		"G"));
		aldoFields.add(new AldoField(46, "NOMBRE DE DUPLICATAS DE LA FICHE DE BOURSE",	"FIL_ZDUPAFBS",	true,	true, 1, 0,		"1"));
		aldoFields.add(new AldoField(47, "INDICATEUR OPER / CLOTURE POS / SERIE OPTION_NEGO",	"FIL_IOPCLPOSSERON",	true,	false, 1, 0,		"G"));
		aldoFields.add(new AldoField(48, "TEXTE INFOS COMPLEMENTAIRES / ORDRE",		"FIL_LINFCPLORD",	false,	false, 23, 0,	""));
		aldoFields.add(new AldoField(49, "CODE SERVICE / DONNEUR_ORDRE",			"FIL_CSERVDDO",		false,	false, 5, 0,	""));
		aldoFields.add(new AldoField(50, "CODE DEVISE / MONTANT BRUT NORME ISO",	"FIL_CDEVQBTRO",	false,	false, 3, 0,	""));
		aldoFields.add(new AldoField(51, "CODE DEVISE / MONTANT FRAIS NORME ISO",	"FIL_CDEVQFRSRO",	false,	false, 3, 0,	""));
		aldoFields.add(new AldoField(52, "TEXTE LIBRE",								"FIL_LINSTCPLMSGSUI",	false,	false, 10, 0,	""));
		aldoFields.add(new AldoField(53, "INDICATEUR AVIS D'OPERES PRE ACCEPTES",	"FIL_IAVIOPEPACT",	false,	false, 1, 0,	""));
		aldoFields.add(new AldoField(54, "DATE TYPE DE LIVRAISON",					"FIL_DATYPLIV",		false,	false, 8, 0,	""));
		aldoFields.add(new AldoField(55, "CODE PLACE DE COTATION",					"FIL_CPLCOT",		false,	false, 3, 0,	""));
		aldoFields.add(new AldoField(56, "CODE LIEU DE DEPOT",						"FIL_CLIEDEP",		false,	false, 4, 0,	""));
		aldoFields.add(new AldoField(57, "CODE DEVISE / REGLEMENT 1",				"FIL_CDEVRG1",		false,	false, 3, 0,	""));
		aldoFields.add(new AldoField(58, "CODE DOSSIER BROKER",						"FIL_CDOSBRK",		false,	false, 11, 0,	""));
		aldoFields.add(new AldoField(59, "BIC DU DEPOSITAIRE BROKER",				"FIL_BICDEPBRK",	false,	false, 11, 0,	""));
		aldoFields.add(new AldoField(60, "LIBELLE DU DEPOSITAIRE BROKER",			"FIL_LDEPBRK",		false,	false, 35, 0,	""));
		aldoFields.add(new AldoField(61, "FILLER",									"FILLER",			false,	false, 2, 0,	""));
		aldoFields.add(new AldoField(62, "TYPE COURTAGE / REPONSE CARNET",			"FIL_YCTGREPO",		false,	false, 1, 0,	""));
		aldoFields.add(new AldoField(63, "MONTANT COURTAGE / REPONSE CARNET",		"FIL_QCTGREPO",		false,	true, 6, 3,	""));
		aldoFields.add(new AldoField(64, "TAUX REMISE NORMAL / NEGO",				"FIL_XREMNGCLI",	false,	true, 4, 3,	""));
		aldoFields.add(new AldoField(65, "INDICATEUR REMISE COURTAGE / SAISIE CARNET",	"FIL_IREMCTGSAICRN",	true,	false, 1, 0,		"N"));

		aldoFields.add(new AldoField(66, "INDICATEUR INVERSION IMPOT NEGO",			"FIL_IIVIMPNG",		false,	false, 1, 0,	""));
		aldoFields.add(new AldoField(67, "INDICATEUR VALIDATION MANUELLE / NEGO",	"FIL_IFOVALING",	false,	false, 1, 0,	""));
		aldoFields.add(new AldoField(68, "DATE EXECUTION / OPERATION",				"FIL_DXTEOP",		true,	true, 8, 0,		""));
		aldoFields.add(new AldoField(69, "HEURE EXECUTION / OPERATION",				"FIL_HXTEOP",		true,	true, 6, 0,		""));
		aldoFields.add(new AldoField(70, "COURS NEGOCIATION / CARNET",				"FIL_PNGCRN",		true,	true, 8, 4,	""));
		aldoFields.add(new AldoField(71, "POURCENTAGE COUPON COURU",				"FIL_XCPCU",		false,	true, 3, 6,	""));
		aldoFields.add(new AldoField(72, "CODE TYPE MODALITE EXECUTION",			"FIL_CYMDTXTE",		true,	false, 1, 0,		""));
		aldoFields.add(new AldoField(73, "QUANTITE DE TITRES EXECUTES",				"FIL_QBTQ_QTITXTE",	true,	true, 13, 2,	""));
		aldoFields.add(new AldoField(74, "INDICATEUR OPERATION SPECIFIQUE",			"FIL_IOPSPEC",		false,	false, 1, 0,	""));
		aldoFields.add(new AldoField(75, "CODE TARIF",								"FIL_CTRIF",		false,	false, 4, 0,	""));
		aldoFields.add(new AldoField(76, "INDICATEUR TAUX COUPON COURU / SAISIE CARNET",	"FIL_IXCPCUSAICRN",	true,	false, 1, 0,		""));
		aldoFields.add(new AldoField(77, "INDICATEUR INVERSION FRAIS DE NEGO",		"FIL_IIVFRSNG",		false,	false, 1, 0,	""));
		aldoFields.add(new AldoField(78, "INDICATEUR FRANCO DE CRA",				"FIL_IFROCRA",		false,	false, 1, 0,	""));
		aldoFields.add(new AldoField(79, "INDICATEUR FRANCO DE DIFFERENTIEL",		"FIL_IFRODIF",		false,	false, 1, 0,	""));
		aldoFields.add(new AldoField(80, "INDICATEUR SYSTEME RELIT",				"FIL_ISYSRL",		false,	false, 1, 0,	""));
		aldoFields.add(new AldoField(81, "CODE ADHERENT / PARTIE",					"FIL_CADHPART",		false,	false, 5, 0,	""));
		aldoFields.add(new AldoField(82, "CODE ADHERENT / CONTREPARTIE",			"FIL_CADHCIE",		false,	false, 5, 0,	""));
		aldoFields.add(new AldoField(83, "TYPE DE VALIDITE DE L'ORDRE",				"FIL_YVALIORD",		false,	false, 1, 0,	""));
		aldoFields.add(new AldoField(84, "FILLER",									"FILLER",			false,	false, 2, 0,	""));
		aldoFields.add(new AldoField(85, "TAUX DE CHANGE SAISI",					"FIL_XCHGSAI",		false,	true, 9, 9,	""));
		aldoFields.add(new AldoField(86, "INDICATEUR AVIS_OPERES PRE_ACCEPTES / REPONSES",	"FIL_IAVIOPEPACTRP",	false,	false, 1, 0,	""));
		aldoFields.add(new AldoField(87, "DATE TYPE DE LIVRAISON RP",				"FIL_DATYPLIVRP",	false,	false, 8, 0,	""));
		aldoFields.add(new AldoField(88, "NUMERO OPERATION CARNET",					"FIL_NOPCRN",		false,	false, 9, 0,	""));
		aldoFields.add(new AldoField(89, "INDICATEUR REPRISE TRAITEMENT",			"FIL_IREPRTRT",		false,	false, 1, 0,	""));
		aldoFields.add(new AldoField(90, "NO SEQUENCE MAILLON CENTRE_ROUTAGE DEST_MESSAGE",	"FIL_NMLNCDRDMSG",	false,	false, 5, 0,		""));
		aldoFields.add(new AldoField(91, "NUMERO REPONSE / CLIENT",					"FIL_NREPOCRN",		true,	true, 2, 0,		"00"));
		aldoFields.add(new AldoField(92, "ZONE DONNEES PRIVATIVES",					"FIL_ZONE_DONPRVT",	false,	false, 80, 0,	""));
		aldoFields.add(new AldoField(93, "NO COMPTE_INTERNL / DEPOSITAIRE BROKER",	"FIL_NCPTEIDEPBRK",	false,	false, 35, 0,	""));
		aldoFields.add(new AldoField(94, "LIBELLE COMPLEMENT INSTRUCTION R/L",		"FIL_LCPLINSTRL",	false,	false, 50, 0,	""));
		aldoFields.add(new AldoField(95, "CODE ETABLISSEMENT / BENEFICIAIRE DES TITRES",	"FIL_CETBNFTIT",	false,	false, 11, 0,		""));
		aldoFields.add(new AldoField(96, "LIBELLE ETABLISSEMENT / BENEFICIAIRE DES TITRES",	"FIL_LETBNFTIT",	false,	false, 35, 0,		""));
		aldoFields.add(new AldoField(97, "NO COMPTE / BENEFICIAIRE DES TITRES",		"FIL_NCPTEBNFTIT",	false,	false, 35, 0,	""));
		aldoFields.add(new AldoField(98, "MONTANT FRAIS BROKER 1",					"FIL_QFRSBRK",		false,	true, 11, 4,	""));
		aldoFields.add(new AldoField(99, "CODE DEVISE / MONTANT FRAIS BROKER 1",	"FIL_CDEVQFRSBRK",	false,	false, 3, 0,	""));

		aldoFields.add(new AldoField(100, "TYPE DE MONTANT FRAIS BROKER 1",			"FIL_YQFRSBRK",		false,	false, 1, 0,	""));
		aldoFields.add(new AldoField(101, "MONTANT FRAIS BROKER 2",					"FIL_QFRSBRK",		false,	true, 11, 4,	""));
		aldoFields.add(new AldoField(102, "CODE DEVISE / MONTANT FRAIS BROKER 2",	"FIL_CDEVQFRSBRK",	false,	false, 3, 0,	""));
		aldoFields.add(new AldoField(103, "TYPE DE MONTANT FRAIS BROKER 2",			"FIL_YQFRSBRK",		false,	false, 1, 0,	""));
		aldoFields.add(new AldoField(104, "MONTANT FRAIS BROKER 3",					"FIL_QFRSBRK",		false,	true, 11, 4,	""));
		aldoFields.add(new AldoField(105, "CODE DEVISE / MONTANT FRAIS BROKER 3",	"FIL_CDEVQFRSBRK",	false,	false, 3, 0,	""));
		aldoFields.add(new AldoField(106, "TYPE DE MONTANT FRAIS BROKER 3",			"FIL_YQFRSBRK",		false,	false, 1, 0,	""));
		aldoFields.add(new AldoField(107, "MONTANT FRAIS BROKER 4",					"FIL_QFRSBRK",		false,	true, 11, 4,	""));
		aldoFields.add(new AldoField(108, "CODE DEVISE / MONTANT FRAIS BROKER 4",	"FIL_CDEVQFRSBRK",	false,	false, 3, 0,	""));
		aldoFields.add(new AldoField(109, "TYPE DE MONTANT FRAIS BROKER 4",			"FIL_YQFRSBRK",		false,	false, 1, 0,	""));
		aldoFields.add(new AldoField(110, "MONTANT FRAIS BROKER 5",					"FIL_QFRSBRK",		false,	true, 11, 4,	""));
		aldoFields.add(new AldoField(111, "CODE DEVISE / MONTANT FRAIS BROKER 5",	"FIL_CDEVQFRSBRK",	false,	false, 3, 0,	""));
		aldoFields.add(new AldoField(112, "TYPE DE MONTANT FRAIS BROKER 5",			"FIL_YQFRSBRK",		false,	false, 1, 0,	""));
		aldoFields.add(new AldoField(113, "MONTANT FRAIS BROKER 6",					"FIL_QFRSBRK",		false,	true, 11, 4,	""));
		aldoFields.add(new AldoField(114, "CODE DEVISE / MONTANT FRAIS BROKER 6",	"FIL_CDEVQFRSBRK",	false,	false, 3, 0,	""));
		aldoFields.add(new AldoField(115, "TYPE DE MONTANT FRAIS BROKER 6",			"FIL_YQFRSBRK",		false,	false, 1, 0,	""));

		aldoFields.add(new AldoField(116, "MONTANT FRAIS BROKER 7",					"FIL_QFRSBRK",		false,	true, 11, 4,	""));
		aldoFields.add(new AldoField(117, "CODE DEVISE / MONTANT FRAIS BROKER 7",	"FIL_CDEVQFRSBRK",	false,	false, 3, 0,	""));
		aldoFields.add(new AldoField(118, "TYPE DE MONTANT FRAIS BROKER 7",			"FIL_YQFRSBRK",		false,	false, 1, 0,	""));
		aldoFields.add(new AldoField(119, "MONTANT FRAIS BROKER 8",					"FIL_QFRSBRK",		false,	true, 11, 4,	""));
		aldoFields.add(new AldoField(120, "CODE DEVISE / MONTANT FRAIS BROKER 8",	"FIL_CDEVQFRSBRK",	false,	false, 3, 0,	""));
		aldoFields.add(new AldoField(121, "TYPE DE MONTANT FRAIS BROKER 8",			"FIL_YQFRSBRK",		false,	false, 1, 0,	""));
		aldoFields.add(new AldoField(122, "MONTANT FRAIS BROKER 9",					"FIL_QFRSBRK",		false,	true, 11, 4,	""));
		aldoFields.add(new AldoField(123, "CODE DEVISE / MONTANT FRAIS BROKER 9",	"FIL_CDEVQFRSBRK",	false,	false, 3, 0,	""));
		aldoFields.add(new AldoField(124, "TYPE DE MONTANT FRAIS BROKER 9",			"FIL_YQFRSBRK",		false,	false, 1, 0,	""));
		aldoFields.add(new AldoField(125, "FILLER",									"FILLER",			false,	false, 2, 0,	""));
		aldoFields.add(new AldoField(126, "CODE TYPE DE LIEU D'EXECUTION",			"FIL_CYLIEXTE",		false,	false, 1, 0,	""));
		aldoFields.add(new AldoField(127, "LIEU D'EXECUTION",						"FIL_LIEXTE",		false,	false, 11, 0,	""));
		aldoFields.add(new AldoField(128, "CODE TYPE D'INTERNALISATION",			"FIL_CYINTNL",		false,	false, 1, 0,	""));
		aldoFields.add(new AldoField(129, "NBRE REPONSES MARCHE / DETAIL POUR REPONSE CLIENT",	"FIL_ZREPODTL",	false,	true, 4, 0,		""));
		aldoFields.add(new AldoField(130, "MONTANT / FRAIS SUPPLEMENTAIRE",			"FIL_QFRSSPL",		false,	true, 14, 4,	""));
		aldoFields.add(new AldoField(131, "TYPE DE MONTANT / FRAIS SUPPLEMENTAIRE / REPONSE",	"FIL_YQFRSSPLREPO",	false,	false, 1, 0,		""));
		aldoFields.add(new AldoField(132, "MONTANT DE TTF",							"FIL_QSADIE",		false,	true, 14, 4,	""));

		aldoFields.add(new AldoField(133, "TYPE DE MONTANT / CODE EXONERATION TTF",	"FIL_YQSADIEREPO",	false,	false, 1, 0,	""));
		aldoFields.add(new AldoField(134, "FILLER",									"FILLER",			false,	false, 12, 0,	""));
		aldoFields.add(new AldoField(135, "POURCENTAGE COUPON COURU / 9 DEC",		"FIL_XCPCU9",		false,	true, 3, 9,	""));
		aldoFields.add(new AldoField(136, "COURS 10 DECIMALES",						"FIL_PNGCRN10D",	false,	true, 8, 10,	""));
		aldoFields.add(new AldoField(137, "FILLER",									"FILLER",			false,	false, 415, 0,	""));

		AldoLine aldo = new AldoLine();
		aldo.setAldoFields(aldoFields);

		if(Debug.CORE) Debug.display(XMLUtil.class, "Création de la structure Aldo terminée.");

		XMLUtil.jaxbObjectToXML(aldo, aldo.getClass(), GlobalConstant.XML_PATH);

		return aldo;
	}


	/*public static void main(String[] args) {
		//MakeXML.build();

		AldoLine aldoLineModel = XMLUtil.buildAldoLineModel();
		try {
			AldoParser.createAldoLine(aldoLineModel);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}*/

}
